<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>xxx</li>
        <li>aaa</li>
    </ul>
</body>
</html>
<script>
    //语法：replaceChild(新节点对象，旧节点)，一定要使用父节点 来调用
    let pdom=document.createElement('p');
    pdom.innerHTML='新节点';
    document.querySelector('ul').replaceChild(pdom,document.querySelector('li'));
</script>